<h1>Listing loans</h1>

<table>
  <tr>
    <th>Book instance</th>
    <th>User</th>
    <th>Status</th>
    <th>Loan date</th>
    <th>Return date</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @loans.each do |loan| %>
  <tr>
    <td><%= loan.book_instance_id %></td>
    <td><%= loan.user_id %></td>
    <td><%= loan.status %></td>
    <td><%= loan.loan_date %></td>
    <td><%= loan.return_date %></td>
    <td><%= link_to 'Show', loan %></td>
    <td><%= link_to 'Edit', edit_loan_path(loan) %></td>
    <td><%= link_to 'Destroy', loan, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Loan', new_loan_path %>
